package com.example.demospring5;

import com.example.demospring5.primary.definebean.FirstBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

@SpringBootApplication
public class DemoSpring5Application {

    public static void main(String[] args) {
        SpringApplication.run(DemoSpring5Application.class, args);

        ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");
        FirstBean firstBean = context.getBean("firstBean", FirstBean.class);
        firstBean.setNameDao("666");
        System.out.println(firstBean);


        FirstBean firstBean2 = context.getBean("firstBean", FirstBean.class);
        System.out.println(firstBean2);

        System.out.println(firstBean == firstBean2);

    }

}
